<template>
	<view class="backos" @click="back">
		<image src="../static/images/backimg.png" mode="widthFix"></image>
		<span :class="type == 1?'white':''">{{title}}</span>
	</view>
</template>

<script>
export default {
	name: '',
	components: {
	},
	props: {
		title:{
			default:'上一页',
			type:String
		},
		type:{
			default:0,
			type:Number
		}
	},
	data() {
		return {
		};
	},
	methods: {
		back(){
			console.log('title',this.title);
			if(this.title == '回到首页'){
				uni.reLaunch({
					url: '/pages/tabbar/index/index'
				})
			}else{
				uni.navigateBack()
			}
		}
	}
};
</script>

<style lang="scss">
	.backos{
		width: 60%;
		height: 70px;
		display: flex;
		align-items: center;
		margin: 0 auto;
		cursor: pointer;
		image{
			width: 50rpx;
			height: 50rpx;
			margin-right: 20rpx	;
		}
		
		span{
			font-size: 34rpx;
			color: #717171;
		}
		
		.white{
			color:#fff
		}
	}
</style>

